<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>圣杯布局</title>
    <style>
        html,
        body {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }

        body {
            display: flex;
            flex-direction: column;
            min-height: 100vh;
        }

        header,
        footer {
            background: #333;
            color: white;
            padding: 1rem;
            text-align: center;
        }

        .container {
            display: flex;
            flex: 1;
        }

        .main {
            flex: 1;
            order: 2;
            background: #f0f0f0;
            padding: 1rem;
        }

        .left {
            width: 200px;
            order: 1;
            background: #ccc;
            padding: 1rem;
        }

        .right {
            width: 200px;
            order: 3;
            background: #ccc;
            padding: 1rem;
        }

        footer {
            margin-top: auto;
        }
    </style>
</head>
<body>
    <header>页眉</header>
    <main class="container">
        <nav class="main">主要内容区</nav>
        <article class="left">左侧边栏</article>
        <aside class="right">右侧边栏</aside>
    </main>
    <footer>页脚</footer>
</body>
</html>